﻿using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Web;
using System.Web.Mvc;

namespace Model
{

    [MetadataType(typeof(SalesOpportunity_Metadata))]
    [DisplayName("SalesOpportunity")]
    public partial class SalesOpportunity
    {
        public SalesOpportunity()
        {
            this.Id = Guid.NewGuid();
            this.UserId = new Guid(HttpContext.Current.User.Identity.Name);
            this.DateTime = DateTime.Now;
            this.CompletedTime = DateTime.Now.AddMonths(1);
        }

        public class SalesOpportunity_Metadata
        {
            [ScaffoldColumn(false)]
            public Guid Id { get; set; }

            [DisplayName("销售机会")]
            [Required]
            public object ChanceName { get; set; }

            [DisplayName("销售金额")]
            [Required]
            public object Money { get; set; }

            [DisplayName("客户名称")]
            [DropDownList("Customer","Id","CustomerName")]
            public object CompanyId { get; set; }


            [DisplayName("联 系 人")]
           
            public object ContactId { get; set; }

            [DisplayName("机会类型")]

            public object BusinessType { get; set; }

            [DisplayName("客户来源")]
            [DropDownList("CustomerSource","Id","CustomerSourceName")]
            public object CustomerSourceId { get; set; }

            

            [DisplayName("预计成交日期")]
            //[DataType(DataType.DateTime)]
            public object CompletedTime { get; set; }

            [DisplayName("下 一 步")]
            [DisplayFormat(ConvertEmptyStringToNull=false)]
            public object NextStep { get; set; }

            [DisplayName("销售阶段")]
            [DropDownList("SaleStage","Id","Name")]
            public object SaleStageId { get; set; }

            [DisplayName("可能性(%)")]
            public object WinRatio { get; set; }

            [DisplayName("负 责 人")]
            [DropDownList("Sys_Users","Id","UserName")]
            public object AdminId { get; set; }

            [DisplayName("阶段描述")]
            [DataType(DataType.MultilineText)]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public object Discription { get; set; }

            [DisplayName("建议")]
            [DataType(DataType.MultilineText)]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public object Suggestion { get; set; }

            [DisplayName("添加时间")]

            [DataType(DataType.DateTime)]
            public object DateTime { get; set; }


            [ScaffoldColumn(false)]
            public Guid UserId { get; set; }

            //[DisplayName("标题")]
            //[Required]
            //public object Title { get; set; }



        }
    }
}
